<?php
/**
 * Created by PhpStorm.
 * User: 38339
 * Date: 2021-05-21
 * Time: 16:49
 */

namespace app\common\model\auth;
use think\Model;

class CommonAdminRole extends Model
{
    protected $name = 'common_admin_role';

    // 设置字段信息
    protected $schema = [
        'id'          => 'int',
        'name'        => 'string', //角色名称
        'is_no_delete'      => 'int',    //是否可删除[0 可以 1不可以]
        'create_time' => 'datetime',    //创建时间
    ];

    /*
     * 获取列表
     */
    public static function getList($where,$limit_start,$page_size){
        $lists =  self::where($where)->order('id','desc')->limit($limit_start,$page_size)->select();
        return $lists;
    }

    /*
     * 获取总数据条数
     */
    public static function getCount($where){
        return self::where($where)->count();
    }

    /*
     * 获取单条数据
     */
    public static function getOne($where){
        return self::where($where)->find();
    }

}